package org.unicamp.gesture;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity {
	private Button newSignature;
	private Button checkSignature;
	private Button eraseSignature;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.main);

		newSignature = (Button) findViewById(R.id.button1);
		newSignature.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(v.getContext(), GestureActivity.class);
				startActivityForResult(intent, 0);
			}
		});
		
		checkSignature = (Button) findViewById(R.id.button2);
		checkSignature.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(v.getContext(), SignatureCheckActivity.class);
				startActivityForResult(intent, 0);
			}
		});
		
		eraseSignature = (Button) findViewById(R.id.button3);
		eraseSignature.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				GestureActivity.eraseSignatures();
				AlertDialog alert = new AlertDialog.Builder(MainActivity.this).create();
				alert.setMessage("Assinatuas Removidas.");
				alert.setCanceledOnTouchOutside(true);
				alert.show();
			}
		});

	}
}
